#include <stdio.h>
#include <stdlib.h>
#include <flgrCoreData.h>
#include <flgrCoreDataIO.h>
#include <flgrCoreCopy.h>
#include <flgrCoreCompare.h>
#include <flgrCoreVector.h>
#include "../macro.h"

/////////////////////////////////////////////////////////////////////////
// Equal 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Equal_I_I(dtype)			\
  dtype rawsrc[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
  dtype rawtst[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
  							\
  ret = flgr1d_compare(dattst,"==",datsrc);		\
  check_ret(ret,FLGR_TRUE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_equal_I_I_fgUINT8(void) {
  tstCompare1d_Equal_I_I(fgUINT8);
}

int testcompare1d_equal_I_I_fgUINT16(void) {
  tstCompare1d_Equal_I_I(fgUINT16);
}

int testcompare1d_equal_I_I_fgUINT32(void) {
  tstCompare1d_Equal_I_I(fgUINT32);
}

int testcompare1d_equal_I_I_fgINT8(void) {
  tstCompare1d_Equal_I_I(fgINT8);
}

int testcompare1d_equal_I_I_fgINT16(void) {
  tstCompare1d_Equal_I_I(fgINT16);
}

int testcompare1d_equal_I_I_fgINT32(void) {
  tstCompare1d_Equal_I_I(fgINT32);
}

int testcompare1d_equal_I_I_fgFLOAT32(void) {
  tstCompare1d_Equal_I_I(fgFLOAT32);
}

int testcompare1d_equal_I_I_fgFLOAT64(void) {
  tstCompare1d_Equal_I_I(fgFLOAT64);
}



/////////////////////////////////////////////////////////////////////////
// Equal_Spp8 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Equal_Spp8_I_I(dtype)		\
  dtype rawsrc[] = {0,0,0,0,0,0,0,0,			\
		    0,0,0,0,0,0,0,0,			\
		    0,0,0,0,0,0,0,0,			\
		    45,45,45,45,45,45,45,45,		\
		    69,69,69,69,69,69,69,69,		\
		    32,32,32,32,32,32,32,32,		\
		    12,12,12,12,12,12,12,12,		\
		    85,85,85,85,85,85,85,85,		\
		    0,0,0,0,0,0,0,0,			\
		    12,12,12,12,12,12,12,12,		\
		    0,0,0,0,0,0,0,0,			\
		    3,3,3,3,3,3,3,3};			\
  dtype rawtst[] = {0,0,0,0,0,0,0,0,			\
		    0,0,0,0,0,0,0,0,			\
		    0,0,0,0,0,0,0,0,			\
		    45,45,45,45,45,45,45,45,		\
		    69,69,69,69,69,69,69,69,		\
		    32,32,32,32,32,32,32,32,		\
		    12,12,12,12,12,12,12,12,		\
		    85,85,85,85,85,85,85,85,		\
		    0,0,0,0,0,0,0,0,			\
		    12,12,12,12,12,12,12,12,		\
		    0,0,0,0,0,0,0,0,			\
		    3,3,3,3,3,3,3,3};			\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,8,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,8,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
  							\
  ret = flgr1d_compare(dattst,"==",datsrc);		\
  check_ret(ret,FLGR_TRUE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_equal_spp8_I_I_fgUINT8(void) {
  tstCompare1d_Equal_Spp8_I_I(fgUINT8);
}

int testcompare1d_equal_spp8_I_I_fgUINT16(void) {
  tstCompare1d_Equal_Spp8_I_I(fgUINT16);
}

int testcompare1d_equal_spp8_I_I_fgUINT32(void) {
  tstCompare1d_Equal_Spp8_I_I(fgUINT32);
}

int testcompare1d_equal_spp8_I_I_fgINT8(void) {
  tstCompare1d_Equal_Spp8_I_I(fgINT8);
}

int testcompare1d_equal_spp8_I_I_fgINT16(void) {
  tstCompare1d_Equal_Spp8_I_I(fgINT16);
}

int testcompare1d_equal_spp8_I_I_fgINT32(void) {
  tstCompare1d_Equal_Spp8_I_I(fgINT32);
}

int testcompare1d_equal_spp8_I_I_fgFLOAT32(void) {
  tstCompare1d_Equal_Spp8_I_I(fgFLOAT32);
}

int testcompare1d_equal_spp8_I_I_fgFLOAT64(void) {
  tstCompare1d_Equal_Spp8_I_I(fgFLOAT64);
}


/////////////////////////////////////////////////////////////////////////
// DIFF 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Diff_I_I(dtype)			\
  dtype rawsrc[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
  dtype rawtst[] = {1,1,1, 0, 0, 0, 0, 0,1, 0,1,1};	\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
							\
  ret = flgr1d_compare(dattst,"!=",datsrc);		\
  check_ret(ret,FLGR_TRUE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_diff_I_I_fgUINT8(void) {
  tstCompare1d_Diff_I_I(fgUINT8);
}

int testcompare1d_diff_I_I_fgUINT16(void) {
  tstCompare1d_Diff_I_I(fgUINT16);
}

int testcompare1d_diff_I_I_fgUINT32(void) {
  tstCompare1d_Diff_I_I(fgUINT32);
}

int testcompare1d_diff_I_I_fgINT8(void) {
  tstCompare1d_Diff_I_I(fgINT8);
}

int testcompare1d_diff_I_I_fgINT16(void) {
  tstCompare1d_Diff_I_I(fgINT16);
}

int testcompare1d_diff_I_I_fgINT32(void) {
  tstCompare1d_Diff_I_I(fgINT32);
}

int testcompare1d_diff_I_I_fgFLOAT32(void) {
  tstCompare1d_Diff_I_I(fgFLOAT32);
}

int testcompare1d_diff_I_I_fgFLOAT64(void) {
  tstCompare1d_Diff_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Sup eq 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Supeq_I_I(dtype)			\
  dtype rawsrc[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
  dtype rawtst[] = {0,0,1,45,69,32,12,85,0,12,0,3};	\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
							\
  ret = flgr1d_compare(dattst,">=",datsrc);		\
  check_ret(ret,FLGR_TRUE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_supeq_I_I_fgUINT8(void) {
  tstCompare1d_Supeq_I_I(fgUINT8);
}

int testcompare1d_supeq_I_I_fgUINT16(void) {
  tstCompare1d_Supeq_I_I(fgUINT16);
}

int testcompare1d_supeq_I_I_fgUINT32(void) {
  tstCompare1d_Supeq_I_I(fgUINT32);
}

int testcompare1d_supeq_I_I_fgINT8(void) {
  tstCompare1d_Supeq_I_I(fgINT8);
}

int testcompare1d_supeq_I_I_fgINT16(void) {
  tstCompare1d_Supeq_I_I(fgINT16);
}

int testcompare1d_supeq_I_I_fgINT32(void) {
  tstCompare1d_Supeq_I_I(fgINT32);
}

int testcompare1d_supeq_I_I_fgFLOAT32(void) {
  tstCompare1d_Supeq_I_I(fgFLOAT32);
}

int testcompare1d_supeq_I_I_fgFLOAT64(void) {
  tstCompare1d_Supeq_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Sup 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Sup_I_I(dtype)			\
  dtype rawsrc[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
  dtype rawtst[] = {1,1,1,45,69,32,12,85,1,13,1,4};	\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
							\
  ret = flgr1d_compare(dattst,">",datsrc);		\
  check_ret(ret,FLGR_FALSE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_sup_I_I_fgUINT8(void) {
  tstCompare1d_Sup_I_I(fgUINT8);
}

int testcompare1d_sup_I_I_fgUINT16(void) {
  tstCompare1d_Sup_I_I(fgUINT16);
}

int testcompare1d_sup_I_I_fgUINT32(void) {
  tstCompare1d_Sup_I_I(fgUINT32);
}

int testcompare1d_sup_I_I_fgINT8(void) {
  tstCompare1d_Sup_I_I(fgINT8);
}

int testcompare1d_sup_I_I_fgINT16(void) {
  tstCompare1d_Sup_I_I(fgINT16);
}

int testcompare1d_sup_I_I_fgINT32(void) {
  tstCompare1d_Sup_I_I(fgINT32);
}

int testcompare1d_sup_I_I_fgFLOAT32(void) {
  tstCompare1d_Sup_I_I(fgFLOAT32);
}

int testcompare1d_sup_I_I_fgFLOAT64(void) {
  tstCompare1d_Sup_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Inf 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Inf_I_I(dtype)			\
  dtype rawsrc[] = {1,1,1,45,69,32,12,85,1,13,1,4};	\
  dtype rawtst[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
							\
  ret = flgr1d_compare(dattst,"<",datsrc);		\
  check_ret(ret,FLGR_FALSE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_inf_I_I_fgUINT8(void) {
  tstCompare1d_Inf_I_I(fgUINT8);
}

int testcompare1d_inf_I_I_fgUINT16(void) {
  tstCompare1d_Inf_I_I(fgUINT16);
}

int testcompare1d_inf_I_I_fgUINT32(void) {
  tstCompare1d_Inf_I_I(fgUINT32);
}

int testcompare1d_inf_I_I_fgINT8(void) {
  tstCompare1d_Inf_I_I(fgINT8);
}

int testcompare1d_inf_I_I_fgINT16(void) {
  tstCompare1d_Inf_I_I(fgINT16);
}

int testcompare1d_inf_I_I_fgINT32(void) {
  tstCompare1d_Inf_I_I(fgINT32);
}

int testcompare1d_inf_I_I_fgFLOAT32(void) {
  tstCompare1d_Inf_I_I(fgFLOAT32);
}

int testcompare1d_inf_I_I_fgFLOAT64(void) {
  tstCompare1d_Inf_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Inf eq 1D
/////////////////////////////////////////////////////////////////////////
#define tstCompare1d_Infeq_I_I(dtype)			\
  dtype rawsrc[] = {1,1,1,45,69,32,12,85,1,13,1,4};	\
  dtype rawtst[] = {0,0,0,45,69,32,12,85,0,12,0,3};	\
							\
							\
  FLGR_Data1D *datsrc, *dattst;				\
  int ret;						\
  							\
  datsrc = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
  dattst = flgr1d_create_##dtype(12,1,FLGR_NO_SHAPE);	\
							\
  flgr1d_import_raw_ptr(datsrc,rawsrc);			\
  flgr1d_import_raw_ptr(dattst,rawtst);			\
							\
  ret = flgr1d_compare(dattst,"<=",datsrc);		\
  check_ret(ret,FLGR_TRUE);				\
							\
  flgr1d_destroy(datsrc);				\
  flgr1d_destroy(dattst);				\
							\
  return 1


int testcompare1d_infeq_I_I_fgUINT8(void) {
  tstCompare1d_Infeq_I_I(fgUINT8);
}

int testcompare1d_infeq_I_I_fgUINT16(void) {
  tstCompare1d_Infeq_I_I(fgUINT16);
}

int testcompare1d_infeq_I_I_fgUINT32(void) {
  tstCompare1d_Infeq_I_I(fgUINT32);
}

int testcompare1d_infeq_I_I_fgINT8(void) {
  tstCompare1d_Infeq_I_I(fgINT8);
}

int testcompare1d_infeq_I_I_fgINT16(void) {
  tstCompare1d_Infeq_I_I(fgINT16);
}

int testcompare1d_infeq_I_I_fgINT32(void) {
  tstCompare1d_Infeq_I_I(fgINT32);
}

int testcompare1d_infeq_I_I_fgFLOAT32(void) {
  tstCompare1d_Infeq_I_I(fgFLOAT32);
}

int testcompare1d_infeq_I_I_fgFLOAT64(void) {
  tstCompare1d_Infeq_I_I(fgFLOAT64);
}




/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Equal_I_I(dtype)					\
									\
  dtype rawsrc[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  dtype rawtst[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  FLGR_Data2D *imgsrc, *imgtst;						\
  int ret;								\
									\
  imgsrc = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
									\
  flgr2d_import_raw_ptr(imgsrc,rawsrc);					\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare(imgtst,"==",imgsrc);				\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgsrc);						\
  flgr2d_destroy(imgtst);						\
									\
  return 1


int testcompare2d_equal_I_I_fgUINT8(void) {
  tstCompare2d_Equal_I_I(fgUINT8);
}

int testcompare2d_equal_I_I_fgUINT16(void) {
  tstCompare2d_Equal_I_I(fgUINT16);
}

int testcompare2d_equal_I_I_fgUINT32(void) {
  tstCompare2d_Equal_I_I(fgUINT32);
}

int testcompare2d_equal_I_I_fgINT8(void) {
  tstCompare2d_Equal_I_I(fgINT8);
}

int testcompare2d_equal_I_I_fgINT16(void) {
  tstCompare2d_Equal_I_I(fgINT16);
}

int testcompare2d_equal_I_I_fgINT32(void) {
  tstCompare2d_Equal_I_I(fgINT32);
}

int testcompare2d_equal_I_I_fgFLOAT32(void) {
  tstCompare2d_Equal_I_I(fgFLOAT32);
}

int testcompare2d_equal_I_I_fgFLOAT64(void) {
  tstCompare2d_Equal_I_I(fgFLOAT64);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Diff_I_I(dtype)					\
									\
  dtype rawsrc[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  dtype rawtst[]={  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		    0,  0,  0,  0,  0,  0,  0,  0,  0,  0};		\
									\
  FLGR_Data2D *imgsrc, *imgtst;						\
  int ret;								\
									\
  imgsrc = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
									\
  flgr2d_import_raw_ptr(imgsrc,rawsrc);					\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare(imgtst,"!=",imgsrc);				\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgsrc);						\
  flgr2d_destroy(imgtst);						\
									\
  return 1


int testcompare2d_diff_I_I_fgUINT8(void) {
  tstCompare2d_Diff_I_I(fgUINT8);
}

int testcompare2d_diff_I_I_fgUINT16(void) {
  tstCompare2d_Diff_I_I(fgUINT16);
}

int testcompare2d_diff_I_I_fgUINT32(void) {
  tstCompare2d_Diff_I_I(fgUINT32);
}

int testcompare2d_diff_I_I_fgINT8(void) {
  tstCompare2d_Diff_I_I(fgINT8);
}

int testcompare2d_diff_I_I_fgINT16(void) {
  tstCompare2d_Diff_I_I(fgINT16);
}

int testcompare2d_diff_I_I_fgINT32(void) {
  tstCompare2d_Diff_I_I(fgINT32);
}

int testcompare2d_diff_I_I_fgFLOAT32(void) {
  tstCompare2d_Diff_I_I(fgFLOAT32);
}

int testcompare2d_diff_I_I_fgFLOAT64(void) {
  tstCompare2d_Diff_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Great_Eq_I_I(dtype)				\
									\
  dtype rawsrc[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  dtype rawtst[]={105,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,  5};		\
									\
  FLGR_Data2D *imgsrc, *imgtst;						\
  int ret;								\
									\
  imgsrc = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
									\
  flgr2d_import_raw_ptr(imgsrc,rawsrc);					\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare(imgtst,">=",imgsrc);				\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgsrc);						\
  flgr2d_destroy(imgtst);						\
									\
  return 1


int testcompare2d_great_eq_I_I_fgUINT8(void) {
  tstCompare2d_Great_Eq_I_I(fgUINT8);
}

int testcompare2d_great_eq_I_I_fgUINT16(void) {
  tstCompare2d_Great_Eq_I_I(fgUINT16);
}

int testcompare2d_great_eq_I_I_fgUINT32(void) {
  tstCompare2d_Great_Eq_I_I(fgUINT32);
}

int testcompare2d_great_eq_I_I_fgINT8(void) {
  tstCompare2d_Great_Eq_I_I(fgINT8);
}

int testcompare2d_great_eq_I_I_fgINT16(void) {
  tstCompare2d_Great_Eq_I_I(fgINT16);
}

int testcompare2d_great_eq_I_I_fgINT32(void) {
  tstCompare2d_Great_Eq_I_I(fgINT32);
}

int testcompare2d_great_eq_I_I_fgFLOAT32(void) {
  tstCompare2d_Great_Eq_I_I(fgFLOAT32);
}

int testcompare2d_great_eq_I_I_fgFLOAT64(void) {
  tstCompare2d_Great_Eq_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Great_I_I(dtype)					\
									\
  dtype rawsrc[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  dtype rawtst[]={106,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,127,		\
		  127,127,127,127,127,127,127,127,127,  6};		\
									\
  FLGR_Data2D *imgsrc, *imgtst;						\
  int ret;								\
									\
  imgsrc = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
									\
  flgr2d_import_raw_ptr(imgsrc,rawsrc);					\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare(imgtst,">",imgsrc);				\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgsrc);						\
  flgr2d_destroy(imgtst);						\
									\
  return 1


int testcompare2d_great_I_I_fgUINT8(void) {
  tstCompare2d_Great_I_I(fgUINT8);
}

int testcompare2d_great_I_I_fgUINT16(void) {
  tstCompare2d_Great_I_I(fgUINT16);
}

int testcompare2d_great_I_I_fgUINT32(void) {
  tstCompare2d_Great_I_I(fgUINT32);
}

int testcompare2d_great_I_I_fgINT8(void) {
  tstCompare2d_Great_I_I(fgINT8);
}

int testcompare2d_great_I_I_fgINT16(void) {
  tstCompare2d_Great_I_I(fgINT16);
}

int testcompare2d_great_I_I_fgINT32(void) {
  tstCompare2d_Great_I_I(fgINT32);
}

int testcompare2d_great_I_I_fgFLOAT32(void) {
  tstCompare2d_Great_I_I(fgFLOAT32);
}

int testcompare2d_great_I_I_fgFLOAT64(void) {
  tstCompare2d_Great_I_I(fgFLOAT64);
}

/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Less_Eq_I_I(dtype)					\
									\
  dtype rawsrc[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  dtype rawtst[]={105,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,123,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  5};		\
									\
  FLGR_Data2D *imgsrc, *imgtst;						\
  int ret;								\
									\
  imgsrc = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
									\
  flgr2d_import_raw_ptr(imgsrc,rawsrc);					\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare(imgtst,"<=",imgsrc);				\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgsrc);						\
  flgr2d_destroy(imgtst);						\
									\
  return 1


int testcompare2d_less_eq_I_I_fgUINT8(void) {
  tstCompare2d_Less_Eq_I_I(fgUINT8);
}

int testcompare2d_less_eq_I_I_fgUINT16(void) {
  tstCompare2d_Less_Eq_I_I(fgUINT16);
}

int testcompare2d_less_eq_I_I_fgUINT32(void) {
  tstCompare2d_Less_Eq_I_I(fgUINT32);
}

int testcompare2d_less_eq_I_I_fgINT8(void) {
  tstCompare2d_Less_Eq_I_I(fgINT8);
}

int testcompare2d_less_eq_I_I_fgINT16(void) {
  tstCompare2d_Less_Eq_I_I(fgINT16);
}

int testcompare2d_less_eq_I_I_fgINT32(void) {
  tstCompare2d_Less_Eq_I_I(fgINT32);
}

int testcompare2d_less_eq_I_I_fgFLOAT32(void) {
  tstCompare2d_Less_Eq_I_I(fgFLOAT32);
}

int testcompare2d_less_eq_I_I_fgFLOAT64(void) {
  tstCompare2d_Less_Eq_I_I(fgFLOAT64);
}


/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Less_I_I(dtype)					\
									\
  dtype rawsrc[]={105,115, 28, 41, 41, 48, 54, 57, 62, 70,		\
		  72, 76, 75, 76, 76, 78, 75, 77, 78, 76,		\
		  75, 79, 77, 76, 77, 73, 71, 64, 62, 55,		\
		  50, 44, 42, 32,123,112,100, 88, 82, 73,		\
		  73, 76, 76, 81, 85, 86, 90, 90, 93, 92,		\
		  91, 96, 96,100, 96, 98, 98, 97,102, 99,		\
		  98, 96, 99,102, 98, 93,100, 99, 94, 96,		\
		  94, 90, 88, 87, 88, 88, 85, 87, 35,  5};		\
									\
  dtype rawtst[]={104,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,		\
		  0,  0,  0,  0,  0,  0,  0,  0,  0,  4};		\
									\
  FLGR_Data2D *imgsrc, *imgtst;						\
  int ret;								\
									\
  imgsrc = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
									\
  flgr2d_import_raw_ptr(imgsrc,rawsrc);					\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare(imgtst,"<",imgsrc);				\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgsrc);						\
  flgr2d_destroy(imgtst);						\
									\
  return 1


int testcompare2d_less_I_I_fgUINT8(void) {
  tstCompare2d_Less_I_I(fgUINT8);
}

int testcompare2d_less_I_I_fgUINT16(void) {
  tstCompare2d_Less_I_I(fgUINT16);
}

int testcompare2d_less_I_I_fgUINT32(void) {
  tstCompare2d_Less_I_I(fgUINT32);
}

int testcompare2d_less_I_I_fgINT8(void) {
  tstCompare2d_Less_I_I(fgINT8);
}

int testcompare2d_less_I_I_fgINT16(void) {
  tstCompare2d_Less_I_I(fgINT16);
}

int testcompare2d_less_I_I_fgINT32(void) {
  tstCompare2d_Less_I_I(fgINT32);
}

int testcompare2d_less_I_I_fgFLOAT32(void) {
  tstCompare2d_Less_I_I(fgFLOAT32);
}

int testcompare2d_less_I_I_fgFLOAT64(void) {
  tstCompare2d_Less_I_I(fgFLOAT64);
}















/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Equal_I_C(dtype)					\
									\
  dtype rawtst[]={104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104};		\
									\
  FLGR_Vector *vec;							\
  dtype cte = 104;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
  									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,"==",vec);			\
  check_ret(ret,FLGR_TRUE);						\
									\
  flgr2d_destroy(imgtst);						\
  flgr_vector_destroy(vec);						\
									\
  return 1


int testcompare2d_equal_I_C_fgUINT8(void) {
  tstCompare2d_Equal_I_C(fgUINT8);
}

int testcompare2d_equal_I_C_fgUINT16(void) {
  tstCompare2d_Equal_I_C(fgUINT16);
}

int testcompare2d_equal_I_C_fgUINT32(void) {
  tstCompare2d_Equal_I_C(fgUINT32);
}

int testcompare2d_equal_I_C_fgINT8(void) {
  tstCompare2d_Equal_I_C(fgINT8);
}

int testcompare2d_equal_I_C_fgINT16(void) {
  tstCompare2d_Equal_I_C(fgINT16);
}

int testcompare2d_equal_I_C_fgINT32(void) {
  tstCompare2d_Equal_I_C(fgINT32);
}

int testcompare2d_equal_I_C_fgFLOAT32(void) {
  tstCompare2d_Equal_I_C(fgFLOAT32);
}

int testcompare2d_equal_I_C_fgFLOAT64(void) {
  tstCompare2d_Equal_I_C(fgFLOAT64);
}



/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Diff_I_C(dtype)					\
									\
  dtype rawtst[]={104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104};		\
									\
  FLGR_Vector *vec;							\
  dtype cte = 105;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,"!=",vec);			\
  check_ret(ret,FLGR_TRUE);						\
									\
  flgr2d_destroy(imgtst);						\
  flgr_vector_destroy(vec);						\
  return 1


int testcompare2d_diff_I_C_fgUINT8(void) {
  tstCompare2d_Diff_I_C(fgUINT8);
}

int testcompare2d_diff_I_C_fgUINT16(void) {
  tstCompare2d_Diff_I_C(fgUINT16);
}

int testcompare2d_diff_I_C_fgUINT32(void) {
  tstCompare2d_Diff_I_C(fgUINT32);
}

int testcompare2d_diff_I_C_fgINT8(void) {
  tstCompare2d_Diff_I_C(fgINT8);
}

int testcompare2d_diff_I_C_fgINT16(void) {
  tstCompare2d_Diff_I_C(fgINT16);
}

int testcompare2d_diff_I_C_fgINT32(void) {
  tstCompare2d_Diff_I_C(fgINT32);
}

int testcompare2d_diff_I_C_fgFLOAT32(void) {
  tstCompare2d_Diff_I_C(fgFLOAT32);
}

int testcompare2d_diff_I_C_fgFLOAT64(void) {
  tstCompare2d_Diff_I_C(fgFLOAT64);
}





/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Great_Eq_I_C(dtype)				\
									\
  dtype rawtst[]={104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,103,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104};		\
									\
  FLGR_Vector *vec;							\
  dtype cte = 103;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,">=",vec);			\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgtst);						\
									\
  flgr_vector_destroy(vec);						\
  return 1


int testcompare2d_great_eq_I_C_fgUINT8(void) {
  tstCompare2d_Great_Eq_I_C(fgUINT8);
}

int testcompare2d_great_eq_I_C_fgUINT16(void) {
  tstCompare2d_Great_Eq_I_C(fgUINT16);
}

int testcompare2d_great_eq_I_C_fgUINT32(void) {
  tstCompare2d_Great_Eq_I_C(fgUINT32);
}

int testcompare2d_great_eq_I_C_fgINT8(void) {
  tstCompare2d_Great_Eq_I_C(fgINT8);
}

int testcompare2d_great_eq_I_C_fgINT16(void) {
  tstCompare2d_Great_Eq_I_C(fgINT16);
}

int testcompare2d_great_eq_I_C_fgINT32(void) {
  tstCompare2d_Great_Eq_I_C(fgINT32);
}

int testcompare2d_great_eq_I_C_fgFLOAT32(void) {
  tstCompare2d_Great_Eq_I_C(fgFLOAT32);
}

int testcompare2d_great_eq_I_C_fgFLOAT64(void) {
  tstCompare2d_Great_Eq_I_C(fgFLOAT64);
}




/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Less_Eq_I_C(dtype)					\
									\
  dtype rawtst[]={104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,105,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104};		\
									\
  FLGR_Vector *vec;							\
  dtype cte = 105;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,"<=",vec);			\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgtst);						\
									\
  flgr_vector_destroy(vec);						\
  return 1


int testcompare2d_less_eq_I_C_fgUINT8(void) {
  tstCompare2d_Less_Eq_I_C(fgUINT8);
}

int testcompare2d_less_eq_I_C_fgUINT16(void) {
  tstCompare2d_Less_Eq_I_C(fgUINT16);
}

int testcompare2d_less_eq_I_C_fgUINT32(void) {
  tstCompare2d_Less_Eq_I_C(fgUINT32);
}

int testcompare2d_less_eq_I_C_fgINT8(void) {
  tstCompare2d_Less_Eq_I_C(fgINT8);
}

int testcompare2d_less_eq_I_C_fgINT16(void) {
  tstCompare2d_Less_Eq_I_C(fgINT16);
}

int testcompare2d_less_eq_I_C_fgINT32(void) {
  tstCompare2d_Less_Eq_I_C(fgINT32);
}

int testcompare2d_less_eq_I_C_fgFLOAT32(void) {
  tstCompare2d_Less_Eq_I_C(fgFLOAT32);
}

int testcompare2d_less_eq_I_C_fgFLOAT64(void) {
  tstCompare2d_Less_Eq_I_C(fgFLOAT64);
}




/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Great_I_C(dtype)					\
									\
  dtype rawtst[]={104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,103,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104};		\
									\
  FLGR_Vector *vec;							\
  dtype cte = 102;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,">",vec);			\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgtst);						\
									\
  flgr_vector_destroy(vec);						\
  return 1


int testcompare2d_great_I_C_fgUINT8(void) {
  tstCompare2d_Great_I_C(fgUINT8);
}

int testcompare2d_great_I_C_fgUINT16(void) {
  tstCompare2d_Great_I_C(fgUINT16);
}

int testcompare2d_great_I_C_fgUINT32(void) {
  tstCompare2d_Great_I_C(fgUINT32);
}

int testcompare2d_great_I_C_fgINT8(void) {
  tstCompare2d_Great_I_C(fgINT8);
}

int testcompare2d_great_I_C_fgINT16(void) {
  tstCompare2d_Great_I_C(fgINT16);
}

int testcompare2d_great_I_C_fgINT32(void) {
  tstCompare2d_Great_I_C(fgINT32);
}

int testcompare2d_great_I_C_fgFLOAT32(void) {
  tstCompare2d_Great_I_C(fgFLOAT32);
}

int testcompare2d_great_I_C_fgFLOAT64(void) {
  tstCompare2d_Great_I_C(fgFLOAT64);
}



/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Less_I_C(dtype)					\
									\
  dtype rawtst[]={104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,103,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104,		\
		  104,104,104,104,104,104,104,104,104,104};		\
									\
  FLGR_Vector *vec;							\
  dtype cte = 105;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,"<",vec);			\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgtst);						\
									\
  flgr_vector_destroy(vec);						\
  return 1


int testcompare2d_less_I_C_fgUINT8(void) {
  tstCompare2d_Less_I_C(fgUINT8);
}

int testcompare2d_less_I_C_fgUINT16(void) {
  tstCompare2d_Less_I_C(fgUINT16);
}

int testcompare2d_less_I_C_fgUINT32(void) {
  tstCompare2d_Less_I_C(fgUINT32);
}

int testcompare2d_less_I_C_fgINT8(void) {
  tstCompare2d_Less_I_C(fgINT8);
}

int testcompare2d_less_I_C_fgINT16(void) {
  tstCompare2d_Less_I_C(fgINT16);
}

int testcompare2d_less_I_C_fgINT32(void) {
  tstCompare2d_Less_I_C(fgINT32);
}

int testcompare2d_less_I_C_fgFLOAT32(void) {
  tstCompare2d_Less_I_C(fgFLOAT32);
}

int testcompare2d_less_I_C_fgFLOAT64(void) {
  tstCompare2d_Less_I_C(fgFLOAT64);
}





/////////////////////////////////////////////////////////////////////////
// Test Macro for all flgr2d_erode types
/////////////////////////////////////////////////////////////////////////
#define tstCompare2d_Less_Spp2_I_C(dtype)				\
									\
  dtype rawtst[]={104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 103,103, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, \
		  104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104, 104,104}; \
									\
  FLGR_Vector *vec;							\
  dtype cte = 105;							\
									\
  FLGR_Data2D *imgtst;							\
  int ret;								\
									\
  imgtst = flgr2d_create_##dtype(8,10,1,FLGR_NO_SHAPE,FLGR_NO_CONNEX);	\
  vec = flgr_vector_create(imgtst->spp,imgtst->type);			\
  flgr_vector_populate_from_scalar_##dtype(vec,cte);			\
									\
  flgr2d_import_raw_ptr(imgtst,rawtst);					\
									\
  ret = flgr2d_compare_const_ptr(imgtst,"<",vec);			\
  check_ret(ret,FLGR_TRUE);						\
  flgr2d_destroy(imgtst);						\
									\
  flgr_vector_destroy(vec);						\
  return 1


int testcompare2d_less_spp2_I_C_fgUINT8(void) {
  tstCompare2d_Less_Spp2_I_C(fgUINT8);
}

int testcompare2d_less_spp2_I_C_fgUINT16(void) {
  tstCompare2d_Less_Spp2_I_C(fgUINT16);
}

int testcompare2d_less_spp2_I_C_fgUINT32(void) {
  tstCompare2d_Less_Spp2_I_C(fgUINT32);
}

int testcompare2d_less_spp2_I_C_fgINT8(void) {
  tstCompare2d_Less_Spp2_I_C(fgINT8);
}

int testcompare2d_less_spp2_I_C_fgINT16(void) {
  tstCompare2d_Less_Spp2_I_C(fgINT16);
}

int testcompare2d_less_spp2_I_C_fgINT32(void) {
  tstCompare2d_Less_Spp2_I_C(fgINT32);
}

int testcompare2d_less_spp2_I_C_fgFLOAT32(void) {
  tstCompare2d_Less_Spp2_I_C(fgFLOAT32);
}

int testcompare2d_less_spp2_I_C_fgFLOAT64(void) {
  tstCompare2d_Less_Spp2_I_C(fgFLOAT64);
}




